<template>
    <div>
       <ul class="mui-table-view">
           <li class="mui-table-view-cell  mui-media" v-for="(item, index) in newsList" :key="index">
               <router-link :to="'/home/newsInfo/' + item.id">
                    <img :src="item.img_url" alt="" class="mui-media-object mui-pull-left">
                    <div class="mui-dedia-body">
                        <h1>{{item.title}}</h1>
                        <p class="mui-ellipsis">
                            <span>发表时间：{{item.add_time}}</span>
                            <span>点击：{{item.click}}</span>
                        </p>
                    </div>
               </router-link>
           </li>
       </ul>
    </div>
</template>
<script>

export default {
    data(){
        return {
            newsList: []
        };
    },
    created(){
        this.getNewsList();
    },
    methods: {
        getNewsList(){
            this.$http.get(this.$api + "/news/list",'get').then(res => {
                this.newsList = res.data.newsList
                console.log(res)
            })
        }
    }
}
</script>
<style lang="scss" scoped>
.mui-table-view {
    li {
        h1 {
            font-size: 14px;
        }
        .mui-ellipsis {
            font-size: 120x;
            color: #226aff;
            display: flex;
            justify-content: space-between;
        }
    }
}

</style>

